﻿// Author: Iulian Lita
// Project: UsersModule.UserActions
// Path: C:\Users\Tym\Documents\Visual Studio 2008\Projects\Library\UsersModule.UserActions
// Creation date: 1/13/2009 11:05 PM
// Last modified: 1/14/2009 4:41 AM

#region Using directives
using DatabaseModule;
using System;
using UsersModule;
#endregion

namespace UsersModule.UserActions
{
    public class PublisherActions
    {

        #region Private Fields
        private Publisher _currentPublisher;
        #endregion
        #region Properties
        public Publisher CurrentPublisher
        {
            get { return _currentPublisher; }
            set { _currentPublisher = value; }
        }
        #endregion

        #region Constructor
        /// <summary>
        /// Initializes a new instance of the PublisherActions class.
        /// </summary>
        /// <param name="currentPublisher">Current publisher</param>
        public PublisherActions(Publisher currentPublisher)
        {
            _currentPublisher = currentPublisher;
        }
        #endregion

        #region Public methods

        /// <summary>
        /// Make request
        /// </summary>
        /// <param name="title">Title</param>
        /// <param name="author">Author</param>
        /// <param name="anAparitie">An aparitie</param>
        /// <param name="domeniu">Domeniu</param>
        /// <param name="tipProdus">Tip produs</param>
        /// <param name="descriere">Descriere</param>
        public void makeRequest(string title, string author, string anAparitie, int domeniu, int tipProdus, string descriere)
        {
            DatabaseWork databaseConnection = new DatabaseWork();
            databaseConnection.AddProductDetails(title, _currentPublisher.PublisherName, tipProdus, domeniu, anAparitie, descriere, "", author);
            databaseConnection.Dispose();
        } // makeRequest(title, author, anAparitie)

        /// <summary>
        /// Add item
        /// </summary>
        /// <param name="pret">Pret</param>
        /// <param name="idProdus">Id produs</param>
        public void addItem(int pret, int idProdus)
        {
            DatabaseWork databaseConection = new DatabaseWork();
            databaseConection.AddItem(idProdus, pret);
            databaseConection.Dispose();
        } // addItem(pret, idProdus)

        #endregion
             
    }
}
